
import java.awt.Color;
import java.util.ArrayList;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author dabeast23
 */
public class WelcomeScreen extends javax.swing.JFrame {

    /** Creates new form WelcomeScreen */
   
    public WelcomeScreen() {
        setResizable(false);
	setTitle("Hotel Kiosk: Welcome");
	setDefaultCloseOperation(this.EXIT_ON_CLOSE);
        initComponents();
        
        reservationList = new ArrayList();
    
        testReservation = new Reservation("Chris Graybosch", "105",1,"0000",245.99);
        reservationList.add(testReservation);
        testReservation = new Reservation("Derrick Lugo", "103",1,"1111",202.99);
        reservationList.add(testReservation);
        this.setLocationRelativeTo(null);
    }
    
    public WelcomeScreen(ArrayList<Reservation> reservationList) {
        setResizable(false);
	setTitle("Hotel Kiosk: Welcome");
	setDefaultCloseOperation(this.EXIT_ON_CLOSE);
        initComponents();
        this.reservationList = reservationList;
        
        this.setLocationRelativeTo(null);
    }

    private void initComponents() {

        backgroundPanel = new javax.swing.JPanel();
        imagePanel = new ImagePanel();
        welcomeButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(255, 255, 255));
        getContentPane().setLayout(new java.awt.GridLayout());

        backgroundPanel.setBackground(new java.awt.Color(102, 0, 0));

        imagePanel.setBackground(new java.awt.Color(255, 255, 255));
        imagePanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, null, new java.awt.Color(0, 0, 0), null, null));

        javax.swing.GroupLayout imagePanelLayout = new javax.swing.GroupLayout(imagePanel);
        imagePanel.setLayout(imagePanelLayout);
        imagePanelLayout.setHorizontalGroup(
            imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 376, Short.MAX_VALUE)
        );
        imagePanelLayout.setVerticalGroup(
            imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 243, Short.MAX_VALUE)
        );

        welcomeButton.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        welcomeButton.setForeground(Color.white);
        welcomeButton.setText("Welcome"); 
        welcomeButton.setContentAreaFilled(false);
        welcomeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                welcomeButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout backgroundPanelLayout = new javax.swing.GroupLayout(backgroundPanel);
        backgroundPanel.setLayout(backgroundPanelLayout);
        backgroundPanelLayout.setHorizontalGroup(
            backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(backgroundPanelLayout.createSequentialGroup()
                .addGroup(backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(backgroundPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(imagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(backgroundPanelLayout.createSequentialGroup()
                        .addGap(99, 99, 99)
                        .addComponent(welcomeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        backgroundPanelLayout.setVerticalGroup(
            backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(backgroundPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(imagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(welcomeButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        getContentPane().add(backgroundPanel);

        pack();
    }

    private void welcomeButtonActionPerformed(java.awt.event.ActionEvent evt) {
        welcomeButton.setEnabled(false);
        ChooseUserScreen CUS = new ChooseUserScreen(reservationList);
        CUS.setVisible(true);
        this.setVisible(false);
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new WelcomeScreen().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify
    private javax.swing.JPanel backgroundPanel;
    private ImagePanel imagePanel;
    private javax.swing.JButton welcomeButton;
    
    private ArrayList <Reservation> reservationList = new ArrayList();
    private Reservation testReservation;
    
    // End of variables declaration

}

